Precision (machine learning)

Precision is the proportion of all the model’s positive classifications that are actually positive. It is a metric for classification models that answers the following question:1

When the model predicted the positive class, what percentage of the predictions were correct?

Here is the formula:

correctly classified actual positiveseverything classified as positive\frac{\text{correctly classified actual positives}}{\text{everything classified as positive}}

which means:

Precision=TPTP+FPPrecision = \frac{TP}{TP+FP}

where:

Precision improves as false positives decrease, while recall improves when false negatives decrease. They often show an inverse relationship, where improving one of them worsens the other. (See also: F1 score)

When (not) to use

Use when it’s very important for positive predictions to be accurate.2

In an imbalanced dataset where the number of actual positives is very, very low, say 1-2 examples in total, precision is less meaningful and less useful as a metric.2

See also

Footnotes

  1. developers.google.com/machine-learning/glossary#precision

  2. ML crash course - Classification 2

2024 © ak